﻿<%@ Page Title="Página principal" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="InfraccionesWeb._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:GridView ID="gdwAgente" runat="server" AutoGenerateColumns="False"
                onrowcancelingedit="gdrAgentes_RowCancelingEdit" 
                onrowdeleting="gdwAgente_RowDeleting" onrowediting="gdrAgentes_RowEditing" 
                onrowupdating="gdrAgentes_RowUpdating">

                <Columns>
                    <asp:TemplateField HeaderText="Identity" >
                        <EditItemTemplate>
                            <asp:TextBox ID="txtIdentity" runat="server" Text='<%# Bind("Identity.value") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Identity.value") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Nombres">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtNombres" runat="server" Text='<%# Bind("Nombres") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Nombres") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Apellidos">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtApellidos" runat="server" Text='<%# Bind("Apellidos") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("Apellidos") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Rango">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtRango" runat="server" Text='<%# Bind("Rango") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("Rango") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Placa">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtPlaca" runat="server" Text='<%# Bind("Placa") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("Placa") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField ShowEditButton="True" />
                    <asp:CommandField ShowDeleteButton="True" />
                </Columns>

            </asp:GridView>

            <br />
            <br />
            <h1>Nuevo Agente</h1>
            <table>
                <tr>
                    <td>Nombres:</td>
                    <td><asp:TextBox ID="txtNuevoNombre" runat="server" MaxLength="100" Width="500px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>Apellidos:</td>
                    <td><asp:TextBox ID="txtNuevaApellido" runat="server"  MaxLength="100" Width="500px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>Rango:</td>
                    <td><asp:TextBox ID="txtNuevaRango" runat="server"  MaxLength="100" Width="500px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>Placa:</td>
                    <td><asp:TextBox ID="txtNuevaPlaca" runat="server"  MaxLength="100" Width="500px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <asp:Button ID="btnGuardar" runat="server" onclick="btnGuardar_Click" Text="Guardar" />
                    </td>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>

</asp:Content>
